<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ page import="com.kylin.common.paginate.*,
				 com.kylin.module.exhibition.orm.Exhibition" %>
<%@ include file="/common/include/taglibs.jsp"%>
<%@ include file="/common/include/pageExpires.jsp"%>
<%@ include file="/common/include/dictNames.jsp"%>
<table width="90%" cellspacing="0" cellpadding="0">
	<tr>
		<td height="30" class="ms02">&nbsp;&nbsp;</td>
	</tr>
	<tr>
			会展管理→会展信息维护→会展信息列表
			<td bgcolor="CDCDCD" height="1"></td>
	</tr>
</table>
<%
    String currLanguage = request.getParameter("language");
    if(currLanguage == null)
        currLanguage = sessionLocale.toString();
%>
<script>
function search(sform){
        sform.parentCat.value = "";
        if(isParentCat(sform.catproduct))
            sform.parentCat.value=sform.catproduct.value
        sform.submit();
}

function changeLanguage(lang){
    location.replace('/admin/exhibition/manageExhibition.do?CMD=search&language='+lang);
}
</script>
<form name="fo1" action="/admin/exhibition/manageExhibition.do?CMD=search" method="post">
<input type="hidden" name="parentCat">
<input type="hidden" name="searchType" value="exhibition">			  
	<!-- 系统支持语言下拉菜单 对应字典名 Constants.SYSLANGUAGE -->
		<mytag:national name="language" onchange="changeLanguage(this.value)" 
             value="<%=currLanguage%>" dictName="<%=Constants.SYSLANGUAGE%>" />
	<!-- 国家下拉菜单，对应字典名 Constants.ALLCOUNTRY-->	
	<mytag:national name="keyword_country" dictName="<%=Constants.ALLCOUNTRY%>"/>

	<!-- 会展类别下拉菜单 对应字典名 dict_exhibition，参见 /common/include/dictNames.jsp -->                                    
	<% 
		        
	 	    List maincatproduct = MemObjFactory.getDict("产品类别",currLanguage);
	        boolean disableSelectParent = false; 
	        out.println(JspHelper.getCatProductSelect(maincatproduct,"catproduct",disableSelectParent));
    %>
		
		<input type="text" name="keyword_title">
		<input type="button" name="button" onclick="search(document.fo1)" value="查询">

</form>
<mytag:MyActionMsg />

<table class='pageTable' cellspacing='0' cellpadding='0'>
     <tr>
        <td class='pageTitle'>ID号</td>
        <td class='pageTitle'>语言</td>
        <td class='pageTitle'>国家</td>
        <td class='pageTitle'>分类</td>
        <td class='pageTitle'>标题</td>
        <td class='pageTitle'>操作</td>
     </tr>
<%
		if (request.getAttribute(Constants.KEY_REQUEST_RESULT) != null) {
		DisplayPage dispage = (DisplayPage) request
		.getAttribute(Constants.KEY_REQUEST_RESULT);

		String ownUrl = "/admin/exhibition/manageExhibition.do?CMD=search";
		String deleteUrl = "/admin/exhibition/manageExhibition.do?CMD=delete&page="
		+ dispage.getPageNumber()
		+ "&searchId="
		+ dispage.getSearchId();
		String editUrl = "/admin/exhibition/manageExhibition.do?CMD=update&page="
		+ dispage.getPageNumber()
		+ "&searchId="
		+ dispage.getSearchId();
		String detailUrl = "/admin/exhibition/manageExhibition.do?CMD=detail&id=";
		
		for (int i = 0; i < dispage.getList().size(); i++) {
			Exhibition obj = (Exhibition) dispage.getList().get(i);
%>
<tr class='row<%=(i % 2)%>'>
	<td class='pageTd'>
		<%=(i+1)%>
	</td>
	<td class='pageTd'>
		<%=UTool.getLanguageName(obj.getLanguage(), Locale.getDefault())%>
	</td>
	<td class='pageTd'>
		<%=UTool.getCountryName(obj.getCountry(),sessionLocale)%>
	</td>
	<td class='pageTd'>
		<% if(obj.getCatExhibition() != null) out.print(obj.getCatExhibition().getName()); %>
	</td>
	<td class='pageTd'>
		<a href="<%=detailUrl + obj.getId()%>"><%=obj.getTitle()%>
	</td>
	<td class='pageTd'>
		<a href="<%=editUrl + "&id=" + obj.getId()%>">编辑</a>
		<a href="<%=deleteUrl + "&id=" + obj.getId()%>">删除</a>
	</td>
</tr>
<%
	}
		out.println("</table>");
		out.print(JspHelper.getPageBar(dispage,ownUrl));	
	} else {
		out.println("未找到记录");
	}
%>


